<!DOCTYPE html>
	<html>
	<head>
		<title>{$site_name}-{$post_title} </title>
		<meta name="keywords" content="{$post_keywords}" />
		<meta name="description" content="{$post_excerpt}">
		<tc_include file="Public:head" />
		<link rel="stylesheet" type="text/css" href="__TMPL__Public/statics/style/css/video-style.css"/>
	</head>
<body class="">
<tc_include file="Public:nav" />
	<php>
	$index_cid=37;// 影视剧集id
	$records = sp_get_child_terms($index_cid);
	
	</php>
	
	<section class="video-sets">
	
	<volist  name="records" id="vo" >
		<php>
			$cid=$vo["term_id"];
			$video = sp_sql_posts("cid:$cid;field:post_date,post_title,post_content,post_excerpt,tid,smeta;order:listorder asc;limit:1;")[0]; 
			$smeta = json_decode($video["smeta"],true);
			
			$records_childs = sp_get_child_terms($cid);
			$baseid = -1;
			$huaxuid= -1;
			$newsid = -1;
			foreach($records_childs as $key=>$voo )
			{
				if("剧情简介" ==$voo["name"]){
					$baseid = $voo["term_id"];
				}else if("拍摄花絮" ==$voo["name"]){
					$huaxuid = $voo["term_id"];
				}else if("相关新闻" ==$voo["name"]){
					$newsid = $voo["term_id"];
				}
			}
		</php>

		<!-- 相关新闻 -->
		<php>
		
		</php>
		<div class="container video-item">
			<div class="cont-desc">
				<div class="product-details">				
					<div class="grid images_3_of_2">
						<img src="{:sp_get_asset_upload_path($smeta['thumb'])}" alt="{$video.post_title}" />
					</div>
					{$video.post_content}
					<div class="clear"></div>
				</div>
				
				<p  class="ff-flag down open"><!--open or close -->
					<span class="f1"><span style="color:#333">展开</span><br><i class="icon-angle-down"></i></span>
				</p>
				<section class="z-news product_desc">
					<div class="star-tabs">
						<ul class="tab-control">
							<li id="tab-control1" class="tab-btn tab-btn-active">剧情简介</li>
							<li id="tab-control2" class="tab-btn">拍摄花絮</li>
							<li id="tab-control3" class="tab-btn">相关新闻</li>
						</ul>
						<ul class="tab-contents">
							<!-- 剧情简介 -->
							<php>
								$base = sp_sql_posts("cid:$baseid;field:post_date,post_title,post_content,post_excerpt,tid,smeta;order:listorder asc;limit:1;")[0]; 
								$basesmeta = json_decode($base["smeta"],true);
								$basephotos = $basesmeta["photo"];
							</php>
							<li id="tab-content1" class="tab-content">
								<div class="row introduce-juqing" style="visibility: visible; animation-name: fadeInUp;">
									<div class="news-detail-content">
										<!--这里是富文本正文-->
										{$base.post_content}
										<volist  name="basephotos" id="p" >
											<img src="{:sp_get_asset_upload_path($p['url'])}" alt="{$p.alt}">
										</volist >
									</div>
								</div>
							</li>
							<!-- 拍摄花絮 -->
							<php>
							$huaxu=sp_sql_posts("cid:$huaxuid;field:post_date,post_title,post_excerpt,tid,smeta;order:listorder asc;limit:4;"); 
							</php>
							<li id="tab-content2" class="tab-content">
								<foreach name="huaxu" item="vooo">
								<!--one news cell by z-->
								<div class="z-news-cell cursor-pointer">
									<div class="newscontent  text-center"  data-href="{:leuu('article/index',array('id'=>$vooo['tid'],'cid'=>$vooo['term_id']))}">
										<div class="z-cell-date">
											<div class="zcell-d-m"><php>echo date('m',strtotime($d));</php>/<php>echo date('d',strtotime($d));</php></div>
											<div class="zcell-year"><php>echo date('Y',strtotime($d));</php></div>
										</div>
										<div class="z-cell-content">
											<div class="zcell-title">{$vooo['post_title']}</div>
											<div class="zcell-brief">{$vooo['post_excerpt']}</div>
										</div>
										<i class="icon-angle-right fr"></i>
									</div>
								</div>
								</foreach>
							</li>
							<!-- 拍摄花絮 -->
							<php>
							$news=sp_sql_posts("cid:$newsid;field:post_date,post_title,post_excerpt,tid,smeta;order:listorder asc;limit:4;"); 
							</php>
							<li id="tab-content3" class="tab-content">
								<foreach name="news" item="voooo">
								<!--one news cell by z-->
								<div class="z-news-cell  cursor-pointer">
									<div class="newscontent  text-center"  data-href="{:leuu('article/index',array('id'=>$voooo['tid'],'cid'=>$voooo['term_id']))}">
										<div class="z-cell-date">
											<div class="zcell-d-m"><php>echo date('m',strtotime($d));</php>/<php>echo date('d',strtotime($d));</php></div>
											<div class="zcell-year"><php>echo date('Y',strtotime($d));</php></div>
										</div>
										<div class="z-cell-content">
											<div class="zcell-title">{$voooo['post_title']}</div>
											<div class="zcell-brief">{$voooo['post_excerpt']}</div>
										</div>
										<i class="icon-angle-right fr"></i>
									</div>
								</div>
								</foreach>
							</li>
						</ul>
					</div>
				</section>
				
				<p  class="ff-flag up"><!--open or close -->
					<span class="f2"><span style="color:#333">收起</span><br><i class="icon-angle-up"></i></span>
				</p>
		   </div>
		</div>
	</volist >
	</section>

<tc_include file="Public:footer"/>
<tc_include file="Public:scripts"/>
<script>

$(function() {
	$(".z-news").each(function(){
		var scope = $(this);
		scope.find("#tab-control1").click(function(){
			if(scope.find("#tab-content1").is(":hidden")){
				scope.find(".tab-btn").removeClass("tab-btn-active");
				$(this).addClass("tab-btn-active");
				scope.find(".tab-content").fadeOut(300);
				scope.find("#tab-content1").delay(200).fadeIn(300);
			}
		});
		scope.find("#tab-control2").click(function(){
			if(scope.find("#tab-content2").is(":hidden")){
				scope.find(".tab-btn").removeClass("tab-btn-active");
				$(this).addClass("tab-btn-active");
				scope.find(".tab-content").fadeOut(300);
				scope.find("#tab-content2").delay(200).fadeIn(300);
			}
		});
		scope.find("#tab-control3").click(function(){
			if(scope.find("#tab-content3").is(":hidden")){
				scope.find(".tab-btn").removeClass("tab-btn-active");
				$(this).addClass("tab-btn-active");
				scope.find(".tab-content").fadeOut(300);
				scope.find("#tab-content3").delay(200).fadeIn(300);
			}
		});
		
		
		//lightbox
		scope.find("#tab-content3 img").click(function(){
			scope.find(".popup-lightbox").fadeIn(400);
		});
		scope.find(".light-box-close").click(function(){
			scope.find(".popup-lightbox").fadeOut(400);
		});
		
	});
	
	$(document).on("click",".ff-flag",function(){
		var  el 	= $(this);
		var  box   	= el.closest(".video-item");
		var  desc	= box.find(".product_desc");
		var  up 	= box.find(".ff-flag.up");
		var  down 	= box.find(".ff-flag.down");
		el.removeClass("open");
		if(el.hasClass("up")){
			down.addClass("open");
			desc.fadeOut();
		}else{
			up.addClass("open");
			desc.fadeIn();
		}
	});
	
});

</script>
</body>
</html>